/*
 * @Author: your name
 * @Date: 2021-08-27 14:32:23
 * @LastEditTime: 2021-08-27 14:41:11
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \briup\5-javascript\day05\5-n的阶乘.js
 */

//递归求n的阶乘  n*(n-1)*(n-2)...*1
//首先判断n是不是<=1的数，因为1！=1
//可以用if...else...来实现
function a(n) {
    if (n <= 1) {
        return 1;
    } else {
        return n * arguments.callee(n - 1);
    }
}
console.log(a(10));